<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>position 定位</title>
    <style>
        #my-div-1 {
            width: 100px;
            height: 100px;
            background-color: red;
            position: relative;
            top: 200px;
            left: 200px;
        }
        
        #my-div-2 {
            position: absolute;
            top: 0;
            width: 100px;
            height: 100px;
            background-color: rosybrown;
        }
        
        #my-div-3 {
            position: absolute;
            top: 50px;
            left: 50px;
            width: 100px;
            height: 100px;
            background-color: royalblue;
        }
        
        #my-div-4 {
            position: fixed;
            top: 0;
            height: 60px;
            width: 100%;
            background-color: darkgray;
        }
    </style>
</head>

<body>
    <div>
        <div style="height: 1500px;border: 1px solid blue;">
        </div>
        <div id="my-div-1">
            1.相对定位relative，相对正常位置
        </div>
        <div id="my-div-2">
            <div id="my-div-3">
                3.绝对定位absolute
            </div>
        </div>

        <div id="my-div-4">

        </div>

    </div>
</body>

</html>